public class Mode {

	private int[] modeValue;

    public Mode(int[] modeValue){
		if(modeValue.length == 3)
            this.modeValue = modeValue;
        else throw new IllegalArgumentException("parameter input format error");
    }

	public String getString() {
		StringBuilder stringBuilder = new StringBuilder();
        for (int item : modeValue) {
            stringBuilder.append(valueToMode(item));
        }
        return stringBuilder.toString();
	}

	private String valueToMode(int modeValue) {
        return (((modeValue >> 2) & 1) == 1 ? "r" : "-")
                + (((modeValue >> 1) & 1) == 1 ? "w" : "-")
                + ((modeValue & 1) == 1 ? "x" : "-");
    }
}